﻿<agc:PopupUserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controlsToolkit="clr-namespace:System.Windows.Controls" 
    xmlns:agfractal="clr-namespace:AgFractal"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:agc="clr-namespace:AgFractal.Controls"
    x:Class="AgFractal.Controls.NewFractalUserControl"
    mc:Ignorable="d" d:DesignHeight="201"
    >
    <Grid Background="White" >
        <Grid Margin="2" Background="#FF111111">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Text="Select a fractal" HorizontalAlignment="Center" Margin="4" Foreground="#FFAAAAAA"/>
            <agc:DoubleClickListBox x:Name="lb" HorizontalAlignment="Center" Style="{StaticResource GlossyBlackListBox}"
                     Grid.Row="1" ItemsSource="{Binding}" Margin="4,0" >
                <agc:DoubleClickListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <controlsToolkit:WrapPanel Width="684"/>
                    </ItemsPanelTemplate>
                </agc:DoubleClickListBox.ItemsPanel>
                <agc:DoubleClickListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical" >
                            <Image Source="{Binding Image}" Width="210" Height="140" HorizontalAlignment="Center" 
                                   Margin="12,12,0,0"/>
                            <TextBlock Text="{Binding Fractal.Name}" HorizontalAlignment="Center" Foreground="#FFD4D4D4" />
                        </StackPanel>
                    </DataTemplate>
                </agc:DoubleClickListBox.ItemTemplate>
            </agc:DoubleClickListBox>
            <StackPanel Margin="4,6" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button x:Name="OKButton" Content="OK" Width="75" Click="OKButton_Click" Style="{StaticResource BlackGlossyButton}"/>
                <Button x:Name="CancelButton" Content="Cancel"  Width="75" Margin="10,0,0,0" Click="CancelButton_Click" Style="{StaticResource BlackGlossyButton}"/>
            </StackPanel>
        </Grid>
    </Grid>
</agc:PopupUserControl>